import {  Switch, Route } from 'react-router-dom'
import AdminDashBoard from './admin/AdminDashBoard'
import UserDashBoard from './admin/UserDashboard'
import Home from './core/Home'
import Shop from './core/Shop'
import Signin from './core/Signin'
import Signup from './core/Signup'
import PrivataUser from './admin/PrivataUser'
import PrivataAdmin from './admin/PrivataAdmin'
import AddCategory from './admin/AddCategory'
import AddProduct from './admin/AddProduct'
import Product from './core/Product'
import Cart from './core/Cart'
import {API} from '../config'

function Routes (){
  console.log(API)
  return (
    <Switch>
      <Route path="/" exact component={Home} />
      <Route path="/shop"  component={Shop} />
      <Route path="/signin" component = {Signin} />
      <Route path="/signup" component = {Signup} />
      <PrivataUser path="/user/dashboard" component = {UserDashBoard} />
      <PrivataAdmin path="/admin/dashboard" component={AdminDashBoard} />
      <PrivataAdmin path="/create/category" component={AddCategory} />
      <PrivataAdmin path="/create/product" component={AddProduct} />
      <Route path="/product/:productId" component = {Product}  />
      <Route path="/cart" component={Cart} />
    </Switch>
  )
}

export default Routes